本文整理汇总了C#中sones.Library.Commons.Security.SecurityToken类的典型用法代码示例。如果您正苦于以下问题:C# SecurityToken类的具体用法?C# SecurityToken怎么用?C# SecurityToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityToken类属于sones.Library.Commons.Security命名空间,在下文中一共展示了SecurityToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetResult
public override QueryResult GetResult(
GQLPluginManager myPluginManager,
IGraphDB myGraphDB,
SecurityToken mySecurityToken,
TransactionToken myTransactionToken)
{
var resultingVertices = new List<IVertexView>();
ASonesException error = null;
#region Specific index
var request = new RequestDescribeIndex(_TypeName, _IndexName, _IndexEdition);
var indices = myGraphDB.DescribeIndex<IEnumerable<IIndexDefinition>>(mySecurityToken, myTransactionToken, request, (stats, definitions) => definitions);
if (indices == null)
{
error = new IndexTypeDoesNotExistException(_TypeName, _IndexName);
}
if (String.IsNullOrEmpty(_IndexEdition))
{
//_IndexEdition = DBConstants.DEFAULTINDEX;
}
resultingVertices = new List<IVertexView>() { GenerateOutput(indices, _IndexName) };
#endregion
if(error != null)
return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Failed, resultingVertices, error);
else
return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Successful, resultingVertices);
}
开发者ID:loubo,项目名称:sones,代码行数:34,代码来源:DescribeIndexDefinition.cs
示例2: Clear
public List<Int64> Clear(SecurityToken mySecurityToken, Int64 myTransactionToken)
{
var Request = ServiceRequestFactory.MakeRequestClear();
var Response = this.GraphDS.Clear(mySecurityToken, myTransactionToken, Request,
ServiceReturnConverter.ConvertOnlyVertexTypeIDs);
return Response.ToList();
}
开发者ID:cosh,项目名称:sones,代码行数:7,代码来源:GraphDS_API.cs
示例3: Execute
public override QueryResult Execute(IGraphDB myGraphDB,
IGraphQL myGraphQL,
GQLPluginManager myPluginManager,
String myQuery,
SecurityToken mySecurityToken,
Int64 myTransactionToken)
{
_queryString = myQuery;
QueryResult result;
try
{
result = myGraphDB.Insert<QueryResult>(
mySecurityToken,
myTransactionToken,
CreateRequest(myPluginManager,
myGraphDB,
mySecurityToken,
myTransactionToken),
CreateQueryResult);
}
catch (ASonesException e)
{
result = new QueryResult(_queryString, SonesGQLConstants.GQL, 0, ResultType.Failed, null, e);
}
return result;
}
开发者ID:ramz,项目名称:sones,代码行数:29,代码来源:InsertNode.cs
示例4: ExecFunc
/// <summary>
/// Executes the function on myCallingObject
/// </summary>
public override FuncParameter ExecFunc(IAttributeDefinition myAttributeDefinition, Object myCallingObject, IVertex myDBObject, IGraphDB myGraphDB, SecurityToken mySecurityToken, TransactionToken myTransactionToken, params FuncParameter[] myParams)
{
var currentInnerEdgeType = ((IOutgoingEdgeDefinition)myAttributeDefinition).InnerEdgeType;
if (myCallingObject is IHyperEdge && currentInnerEdgeType.HasProperty("Weight"))
{
var hyperEdge = myCallingObject as IHyperEdge;
if (currentInnerEdgeType.HasProperty("Weight"))
{
var weightProperty = currentInnerEdgeType.GetPropertyDefinition("Weight");
var maxWeight = hyperEdge.InvokeHyperEdgeFunc<Double>(singleEdges =>
{
return Convert.ToDouble(
weightProperty.GetValue(
singleEdges
.OrderByDescending(edge => weightProperty.GetValue(edge))
.First()));
});
return new FuncParameter(maxWeight);
}
}
throw new InvalidTypeException(myCallingObject.GetType().ToString(), "Weighted IHyperEdge");
}
开发者ID:loubo,项目名称:sones,代码行数:31,代码来源:MaxWeightFunc.cs
示例5: Execute
public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
{
Query = myQuery;
var indexDef = new IndexPredefinition(_IndexName);
indexDef.SetIndexType(_IndexType);
indexDef.SetVertexType(_DBType);
indexDef.SetEdition(_IndexEdition);
//to be indices attributes
foreach (var aIndexedProperty in _AttributeList)
{
indexDef.AddProperty(aIndexedProperty.IndexAttribute.ContentString);
}
//options for the index
if (_options != null)
{
foreach (var aKV in _options)
{
indexDef.AddOption(aKV.Key, aKV.Value);
}
}
return myGraphDB.CreateIndex<QueryResult>(mySecurityToken, myTransactionToken, new RequestCreateIndex(indexDef), GenerateResult);
}
开发者ID:loubo,项目名称:sones,代码行数:26,代码来源:CreateIndexNode.cs
示例6: AddVertex
public IVertex AddVertex(RequestInsertVertex myInsertDefinition, TransactionToken myTransaction, SecurityToken mySecurity)
{
IVertexType vertexType = GetVertexType(myInsertDefinition.VertexTypeName, myTransaction, mySecurity);
if (vertexType.IsAbstract)
throw new AbstractConstraintViolationException(myInsertDefinition.VertexTypeName);
ConvertUnknownProperties(myInsertDefinition, vertexType);
ConvertDefaultValues(myInsertDefinition, vertexType);
if (myInsertDefinition.OutgoingEdges != null)
CheckOutgoingEdges(myInsertDefinition.OutgoingEdges, vertexType);
if (myInsertDefinition.StructuredProperties != null)
{
CheckAddStructuredProperties(myInsertDefinition.StructuredProperties, vertexType);
}
CheckMandatoryConstraint(myInsertDefinition, vertexType);
if (myInsertDefinition.BinaryProperties != null)
CheckAddBinaryProperties(myInsertDefinition, vertexType);
return null;
}
开发者ID:loubo,项目名称:sones,代码行数:25,代码来源:CheckVertexHandler.cs
示例7: ExecFunc
public override FuncParameter ExecFunc(IAttributeDefinition myAttributeDefinition, Object myCallingObject, IVertex myDBObject, IGraphDB myGraphDB, SecurityToken mySecurityToken, TransactionToken myTransactionToken, params FuncParameter[] myParams)
{
if (!(myCallingObject is String))
{
throw new FunctionParameterTypeMismatchException(typeof(String), myCallingObject.GetType());
}
var pos = Convert.ToInt32(myParams[0].Value);
StringBuilder resString = new StringBuilder();
bool dontInsert = false;
if (pos > (myCallingObject as String).Length)
{
dontInsert = true;
resString.Append((myCallingObject as String).ToString());
}
else
{
resString.Append((myCallingObject as String).ToString().Substring(0, pos));
}
foreach (FuncParameter fp in myParams.Skip(1))
{
resString.Append(fp.Value as String);
}
if(!dontInsert)
resString.Append((myCallingObject as String).ToString().Substring(pos));
return new FuncParameter(resString.ToString());
}
开发者ID:loubo,项目名称:sones,代码行数:32,代码来源:InsertFunc.cs
示例8: Execute
public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
{
_query = myQuery;
var vertexType = myGraphDB.GetVertexType<IVertexType>(
mySecurityToken,
myTransactionToken,
new RequestGetVertexType(_typeName),
(stats, vType) => vType);
_WhereExpression.Validate(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken, vertexType);
var expressionGraph = _WhereExpression.Calculon(myPluginManager, myGraphDB, mySecurityToken,
myTransactionToken,
new CommonUsageGraph(myGraphDB, mySecurityToken,
myTransactionToken));
var toBeDeletedVertices =
expressionGraph.Select(
new LevelKey(vertexType.ID, myGraphDB, mySecurityToken, myTransactionToken),
null, true);
//TODO: do sth that is better than that: ew RequestDelete(new RequestGetVertices(_typeName, toBeDeletedVertices.Select(_ => _.VertexID))).
return myGraphDB.Delete<QueryResult>(
mySecurityToken,
myTransactionToken,
new RequestDelete(new RequestGetVertices(_typeName, toBeDeletedVertices.Select(_ => _.VertexID))).AddAttributes(_toBeDeletedAttributes),
CreateQueryResult);
}
开发者ID:loubo,项目名称:sones,代码行数:29,代码来源:DeleteNode.cs
示例9: ExecFunc
public override FuncParameter ExecFunc(IAttributeDefinition myAttributeDefinition, Object myCallingObject, IVertex myDBObject, IGraphDB myGraphDB, SecurityToken mySecurityToken, TransactionToken myTransactionToken, params FuncParameter[] myParams)
{
if (myCallingObject is IHyperEdge)
{
return new FuncParameter((UInt64)((IHyperEdge)myCallingObject).GetAllEdges().Count());
}
else if (myCallingObject is ISingleEdge)
{
UInt64 count = 1;
return new FuncParameter(count);
}
else if (myCallingObject is IncomingEdgeCollection)
{
return new FuncParameter((UInt64)(myCallingObject as IncomingEdgeCollection).LongCount());
}
else if (myCallingObject is IEnumerable<long>)
{
return new FuncParameter((UInt64)(myCallingObject as IEnumerable<long>).LongCount());
}
else if (myCallingObject is IEnumerable<IVertex>)
{
return new FuncParameter((UInt64)(myCallingObject as IEnumerable<IVertex>).LongCount());
}
else
{
throw new UnknownDBException("Unexpected input for COUNT aggregate.");
}
}
开发者ID:loubo,项目名称:sones,代码行数:28,代码来源:CountFunc.cs
示例10: CreateQueryPlan
/// <summary>
/// Creates a query plan using a logic expression
/// </summary>
/// <param name="myExpression">The logic expression</param>
/// <param name="myIsLongRunning">Determines whether it is anticipated that the request could take longer</param>
/// <param name="myTransaction">The current transaction token</param>
/// <param name="mySecurity">The current security token</param>
/// <returns>A query plan</returns>
public IQueryPlan CreateQueryPlan(IExpression myExpression,
Boolean myIsLongRunning,
Int64 myTransaction,
SecurityToken mySecurity)
{
IQueryPlan result;
switch (myExpression.TypeOfExpression)
{
case TypeOfExpression.Binary:
result = GenerateFromBinaryExpression((BinaryExpression) myExpression, myIsLongRunning, myTransaction, mySecurity);
break;
case TypeOfExpression.Unary:
result = GenerateFromUnaryExpression((UnaryExpression)myExpression, myTransaction, mySecurity);
break;
case TypeOfExpression.Property:
result = GenerateFromPropertyExpression((PropertyExpression)myExpression, myTransaction, mySecurity);
break;
default:
throw new ArgumentOutOfRangeException();
}
return result;
}
开发者ID:anukat2015,项目名称:sones,代码行数:41,代码来源:QueryPlanManager.cs
示例11: Execute
public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
{
var sw = Stopwatch.StartNew();
QueryResult result = null;
if (_DumpFormat.ToString().ToUpper().Equals("GQL"))
{
var plugin = myPluginManager.GetAndInitializePlugin<IGraphDBExport>("GQLEXPORT");
if (plugin != null)
{
result = plugin.Export(_DumpDestination, _DumpableGrammar, myGraphDB, myGraphQL, mySecurityToken, myTransactionToken, _TypesToDump, _DumpType);
}
}
sw.Stop();
if (result != null)
{
return new QueryResult(myQuery, _DumpFormat.ToString(), (ulong)sw.ElapsedMilliseconds, result.TypeOfResult, result.Vertices, result.Error);
}
else
return null;
}
开发者ID:loubo,项目名称:sones,代码行数:25,代码来源:DumpNode.cs
示例12: GetVertices
public override IEnumerable<IVertex> GetVertices(RequestGetVertices _request, Int64 Int64, SecurityToken SecurityToken)
{
#region case 1 - Expression
if (_request.Expression != null)
{
if (!_queryPlanManager.IsValidExpression(_request.Expression))
{
throw new InvalidExpressionException(_request.Expression);
}
}
#endregion
#region case 2 - No Expression
else if (_request.VertexTypeName != null)
{
//2.1 typeName as string
_vertexTypeManager.CheckManager.GetType(_request.VertexTypeName, Int64, SecurityToken);
}
else
{
//2.2 type as id
_vertexTypeManager.CheckManager.GetType(_request.VertexTypeID, Int64, SecurityToken);
}
#endregion
return null;
}
开发者ID:anukat2015,项目名称:sones,代码行数:31,代码来源:CheckVertexHandler.cs
示例13: AlterVertexType
public ServiceVertexType AlterVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken,
ServiceVertexType myVertexType, ServiceAlterVertexChangeset myChangeset)
{
var Request = ServiceRequestFactory.MakeRequestAlterVertexType(myVertexType, myChangeset);
var Response = this.GraphDS.AlterVertexType<IVertexType>(mySecurityToken, myTransactionToken, Request,
ServiceReturnConverter.ConvertOnlyVertexType);
return new ServiceVertexType(Response);
}
开发者ID:cosh,项目名称:sones,代码行数:8,代码来源:GraphDS_API.cs
示例14: CommonUsageGraph
/// <summary>
/// Constructor
/// </summary>
public CommonUsageGraph(IGraphDB myIGraphDB, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
: this()
{
_iGraphDB = myIGraphDB;
_securityToken = mySecurityToken;
_transactionToken = myTransactionToken;
_Levels = new Dictionary<int, IExpressionLevel>();
}
开发者ID:loubo,项目名称:sones,代码行数:11,代码来源:CommonUsageGraph.cs
示例15: LevelKey
public LevelKey(IEnumerable<EdgeKey> myEdgeKey, IGraphDB myGraphDB, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
{
Edges = new List<EdgeKey>();
foreach (var aEdgeKey in myEdgeKey)
{
if (aEdgeKey.IsAttributeSet)
{
var vertexType = myGraphDB.GetVertexType<IVertexType>
(mySecurityToken,
myTransactionToken,
new RequestGetVertexType(aEdgeKey.VertexTypeID),
(stats, type) => type);
var attribute = vertexType.GetAttributeDefinition(aEdgeKey.AttributeID);
if (attribute != null && attribute.Kind != AttributeType.Property)
{
//so there is an edge
Edges.Add(aEdgeKey);
Level++;
AddHashCodeFromSingleEdge(ref _hashcode, aEdgeKey);
}
else
{
if (Level == 0)
{
var newEdgeKey = new EdgeKey(aEdgeKey.VertexTypeID);
Edges.Add(newEdgeKey);
AddHashCodeFromSingleEdge(ref _hashcode, newEdgeKey);
break;
}
else
{
break;
}
}
}
else
{
if (Level == 0)
{
Edges.Add(aEdgeKey);
AddHashCodeFromSingleEdge(ref _hashcode, aEdgeKey);
break;
}
else
{
break;
}
}
}
}
开发者ID:loubo,项目名称:sones,代码行数:58,代码来源:LevelKey.cs
示例16: GetResult
public override QueryResult GetResult( GQLPluginManager myPluginManager,
IGraphDB myGraphDB,
SecurityToken mySecurityToken,
Int64 myTransactionToken)
{
var resultingVertices = new List<IVertexView>();
ASonesException error = null;
if (!String.IsNullOrEmpty(_EdgeName))
{
#region Specific edge
var request = new RequestGetEdgeType(_EdgeName);
var edge = myGraphDB.GetEdgeType<IEdgeType>(mySecurityToken,
myTransactionToken,
request,
(stats, edgeType) => edgeType);
if (edge != null)
{
resultingVertices = new List<IVertexView>() { GenerateOutput(edge, _EdgeName) };
}
else
{
error = new EdgeTypeDoesNotExistException(_EdgeName);
}
#endregion
}
else
{
#region All edges
var resultingReadouts = new List<IVertexView>();
var request = new RequestGetAllEdgeTypes();
foreach (var edge in myGraphDB.GetAllEdgeTypes<IEnumerable<IEdgeType>>(mySecurityToken,
myTransactionToken,
request,
(stats, edgeTypes) => edgeTypes))
{
resultingReadouts.Add(GenerateOutput(edge, edge.Name));
}
#endregion
}
if(error != null)
return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Failed, resultingVertices, error);
else
return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Successful, resultingVertices);
}
开发者ID:ramz,项目名称:sones,代码行数:57,代码来源:DescribeEdgeDefinition.cs
示例17: AComparativeOperator
/// <summary>
/// Creates a new comparative operator
/// </summary>
/// <param name="myProperty">The interesting property</param>
/// <param name="myConstant">The constant value</param>
/// <param name="myIsLongrunning">Determines whether it is anticipated that the request could take longer</param>
/// <param name="mySecurityToken">The current security token</param>
/// <param name="myTransactionToken">The current transaction token</param>
/// <param name="myVertexStore">The vertex store that is needed to load the vertices</param>
protected AComparativeOperator(QueryPlanProperty myProperty, ILiteralExpression myConstant, Boolean myIsLongrunning, SecurityToken mySecurityToken, Int64 myTransactionToken, IVertexStore myVertexStore)
{
_property = myProperty;
_constant = myConstant;
_isLongrunning = myIsLongrunning;
_vertexStore = myVertexStore;
_securityToken = mySecurityToken;
_transactionToken = myTransactionToken;
}
开发者ID:anukat2015,项目名称:sones,代码行数:18,代码来源:AComparativeOperator.cs
示例18: Execute
public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
{
_query = myQuery;
return myGraphDB.AlterVertexType<QueryResult>(
mySecurityToken,
myTransactionToken,
CreateNewRequest(myGraphDB, myPluginManager, mySecurityToken, myTransactionToken),
CreateOutput);
}
开发者ID:karsten-wolfert,项目名称:sones,代码行数:10,代码来源:AlterVertexTypeNode.cs
示例19: StringParser
public List<TypeWithProperty> StringParser(String current_string, IGraphDB myDB, SecurityToken mySecurityToken, Int64 myTransactionToken)
{
current_string = current_string.Replace(" ","");
List<TypeWithProperty> list = new List<TypeWithProperty>();
bool endFlag = false;
int EndPos = 0;
do
{
EndPos = current_string.IndexOf(',');
if (EndPos == -1)
{
EndPos = current_string.Length;
endFlag = true;
}
var typeVertexString = current_string.Substring(0, current_string.IndexOf('.'));
IVertexType typeVertex = null;
try
{
typeVertex = myDB.GetVertexType<IVertexType>(
mySecurityToken,
myTransactionToken,
new sones.GraphDB.Request.RequestGetVertexType(typeVertexString),
(statistics, type) => type);
}
catch
{
throw new InvalidFunctionParameterException("edgeType", "Object reference not set to an instance of an object.", "null");
}
var propertyIDString = current_string.Substring(current_string.IndexOf('.') + 1, EndPos - current_string.IndexOf('.') - 1);
var property = typeVertex.GetPropertyDefinition(propertyIDString);
if (property==null)
throw new InvalidFunctionParameterException("Property", "Property: " + propertyIDString + " not exist in VertexType:" + typeVertexString, "null");
TypeWithProperty value = new TypeWithProperty();
value.propertyDifinition = property;
value.type = typeVertex;
if (!list.Contains(value))
list.Add(value);
if (!endFlag)
current_string = current_string.Substring(EndPos + 1);
}
while (endFlag != true);
return list;
}
开发者ID:kuba85,项目名称:sones,代码行数:55,代码来源:TypeWithProperty.cs
示例20: GetResult
public override IEnumerable<IVertexView> GetResult(
GQLPluginManager myPluginManager,
IGraphDB myGraphDB,
SecurityToken mySecurityToken,
Int64 myTransactionToken)
{
var resultingVertices = new List<IVertexView>();
if (!String.IsNullOrEmpty(_EdgeName))
{
#region Specific edge
var request = new RequestGetEdgeType(_EdgeName);
var edge = myGraphDB.GetEdgeType<IEdgeType>(mySecurityToken,
myTransactionToken,
request,
(stats, edgeType) => edgeType);
if (edge != null)
{
resultingVertices = new List<IVertexView>() { GenerateOutput(edge, _EdgeName) };
}
else
{
throw new EdgeTypeDoesNotExistException(_EdgeName);
}
#endregion
}
else
{
#region All edges
var resultingReadouts = new List<IVertexView>();
var request = new RequestGetAllEdgeTypes();
foreach (var edge in myGraphDB.GetAllEdgeTypes<IEnumerable<IEdgeType>>(mySecurityToken,
myTransactionToken,
request,
(stats, edgeTypes) => edgeTypes))
{
resultingReadouts.Add(GenerateOutput(edge, edge.Name));
}
#endregion
}
return resultingVertices;
}
开发者ID:anukat2015,项目名称:sones,代码行数:55,代码来源:DescribeEdgeDefinition.cs
注:本文中的sones.Library.Commons.Security.SecurityToken类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论