public QueryOperationContext queryAuthorize(String queryString, Set regionNames, Object[] queryParams) throws NotAuthorizedException { if (regionNames == null) { regionNames = new HashSet(); } QueryOperationContext queryContext = new QueryOperationContext(queryString, regionNames, false, queryParams); if (!this.authzCallback.authorizeOperation(null, queryContext)) { String errStr = String.format("Not authorized to perfom QUERY operation [%s] on the cache", queryString); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest( toString() + ": Authorized to perform QUERY operation [" + queryString + "] on cache"); } } return queryContext; }
public ExecuteCQOperationContext executeCQAuthorize(String cqName, String queryString, Set regionNames) throws NotAuthorizedException { if (regionNames == null) { regionNames = new HashSet(); } ExecuteCQOperationContext executeCQContext = new ExecuteCQOperationContext(cqName, queryString, regionNames, false); if (!this.authzCallback.authorizeOperation(null, executeCQContext)) { String errStr = String.format("Not authorized to perfom EXECUTE_CQ operation [%s] on the cache", queryString); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform EXECUTE_CQ operation [" + queryString + "] on cache"); } } return executeCQContext; }
public void stopCQAuthorize(String cqName, String queryString, Set regionNames) throws NotAuthorizedException { StopCQOperationContext stopCQContext = new StopCQOperationContext(cqName, queryString, regionNames); if (!this.authzCallback.authorizeOperation(null, stopCQContext)) { String errStr = String.format("Not authorized to perfom STOP_CQ operation [%s] on the cache", cqName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform STOP_CQ operation [" + cqName + ',' + queryString + "] on cache"); } } }
public void containsKeyAuthorize(String regionName, Object key) throws NotAuthorizedException { ContainsKeyOperationContext containsKeyContext = new ContainsKeyOperationContext(key); if (!this.authzCallback.authorizeOperation(regionName, containsKeyContext)) { String errStr = String.format("Not authorized to perform CONTAINS_KEY operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform CONTAINS_KEY operation on region [" + regionName + ']'); } } }
public void closeCQAuthorize(String cqName, String queryString, Set regionNames) throws NotAuthorizedException { CloseCQOperationContext closeCQContext = new CloseCQOperationContext(cqName, queryString, regionNames); if (!this.authzCallback.authorizeOperation(null, closeCQContext)) { String errStr = String.format("Not authorized to perfom CLOSE_CQ operation [%s] on the cache", cqName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform CLOSE_CQ operation [" + cqName + ',' + queryString + "] on cache"); } } }
public void createRegionAuthorize(String regionName) throws NotAuthorizedException { RegionCreateOperationContext regionCreateContext = new RegionCreateOperationContext(false); if (!this.authzCallback.authorizeOperation(regionName, regionCreateContext)) { String errStr = String.format("Not authorized to perform CREATE_REGION operation for the region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform REGION_CREATE operation of region [" + regionName + ']'); } } }
public KeySetOperationContext keySetAuthorize(String regionName) throws NotAuthorizedException { KeySetOperationContext keySetContext = new KeySetOperationContext(false); if (!this.authzCallback.authorizeOperation(regionName, keySetContext)) { String errStr = String.format("Not authorized to perform KEY_SET operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform KEY_SET operation on region [" + regionName + ']'); } } return keySetContext; }
public UnregisterInterestOperationContext unregisterInterestListAuthorize(String regionName, List keys) throws NotAuthorizedException { UnregisterInterestOperationContext unregisterInterestListContext; unregisterInterestListContext = new UnregisterInterestOperationContext(keys, InterestType.LIST); if (!this.authzCallback.authorizeOperation(regionName, unregisterInterestListContext)) { String errStr = String.format( "Not authorized to perform UNREGISTER_INTEREST_LIST operation for region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest( toString() + ": Authorized to perform UNREGISTER_INTEREST_LIST operation for region [" + regionName + ']'); } } return unregisterInterestListContext; }
public void getDurableCQsAuthorize() throws NotAuthorizedException { GetDurableCQsOperationContext getDurableCQsContext = new GetDurableCQsOperationContext(); if (!this.authzCallback.authorizeOperation(null, getDurableCQsContext)) { String errStr = "Not authorized to perform GET_DURABLE_CQS operation on cache"; this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger .finest(toString() + ": Authorized to perform GET_DURABLE_CQS operation on cache"); } } }
public RegionClearOperationContext clearAuthorize(String regionName, Object callbackArg) throws NotAuthorizedException { RegionClearOperationContext regionClearContext = new RegionClearOperationContext(false); regionClearContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, regionClearContext)) { String errStr = String.format("Not authorized to perform REGION_CLEAR operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform REGION_CLEAR operation on region [" + regionName + ']'); } } return regionClearContext; }
public DestroyOperationContext destroyAuthorize(String regionName, Object key, Object callbackArg) throws NotAuthorizedException { DestroyOperationContext destroyEntryContext = new DestroyOperationContext(key); destroyEntryContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, destroyEntryContext)) { String errStr = String.format("Not authorized to perform DESTROY operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform DESTROY operation on region [" + regionName + ']'); } } return destroyEntryContext; }
public RegionDestroyOperationContext destroyRegionAuthorize(String regionName, Object callbackArg) throws NotAuthorizedException { RegionDestroyOperationContext regionDestroyContext = new RegionDestroyOperationContext(false); regionDestroyContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, regionDestroyContext)) { String errStr = String.format("Not authorized to perform REGION_DESTROY operation for the region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform REGION_DESTROY operation for region [" + regionName + ']'); } } return regionDestroyContext; }
public UnregisterInterestOperationContext unregisterInterestAuthorize(String regionName, Object key, int interestType) throws NotAuthorizedException { UnregisterInterestOperationContext unregisterInterestContext; unregisterInterestContext = new UnregisterInterestOperationContext(key, InterestType.fromOrdinal((byte) interestType)); if (!this.authzCallback.authorizeOperation(regionName, unregisterInterestContext)) { String errStr = String.format("Not authorized to perform UNREGISTER_INTEREST operation for region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform DESTROY operation on region [" + regionName + ']'); } } return unregisterInterestContext; }
public PutOperationContext putAuthorize(String regionName, Object key, Object value, boolean isObject, Object callbackArg, byte opType) throws NotAuthorizedException { PutOperationContext putContext = new PutOperationContext(key, value, isObject, opType, false); putContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, putContext)) { String errStr = String.format("Not authorized to perform PUT operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest( toString() + ": Authorized to perform PUT operation on region [" + regionName + ']'); } } return putContext; }
public InvalidateOperationContext invalidateAuthorize(String regionName, Object key, Object callbackArg) throws NotAuthorizedException { InvalidateOperationContext invalidateEntryContext = new InvalidateOperationContext(key); invalidateEntryContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, invalidateEntryContext)) { String errStr = String.format("Not authorized to perform INVALIDATE operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform INVALIDATE operation on region [" + regionName + ']'); } } return invalidateEntryContext; }
public RegisterInterestOperationContext registerInterestAuthorize(String regionName, Object key, int interestType, InterestResultPolicy policy) throws NotAuthorizedException { RegisterInterestOperationContext registerInterestContext = new RegisterInterestOperationContext( key, InterestType.fromOrdinal((byte) interestType), policy); if (!this.authzCallback.authorizeOperation(regionName, registerInterestContext)) { String errStr = String.format("Not authorized to perform REGISTER_INTEREST operation for region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger .finest(toString() + ": Authorized to perform REGISTER_INTEREST operation for region [" + regionName + ']'); } } return registerInterestContext; }
public GetOperationContext getAuthorize(String regionName, Object key, Object result, boolean isObject, GetOperationContext getContext) throws NotAuthorizedException { if (getContext == null) { getContext = new GetOperationContextImpl(key, true); } else { getContext.setPostOperation(); } getContext.setObject(result, isObject); if (!this.postAuthzCallback.authorizeOperation(regionName, getContext)) { String errStr = String.format("In post-process: not authorized to perform GET operation on region %s", regionName); this.logger.warning(String.format("%s : %s", new Object[] {this.id, errStr})); if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger .finest(this.id + ": In post-process: authorized to perform GET operation on region [" + regionName + ']'); } } return getContext; }
public GetOperationContext getAuthorize(String regionName, Object key, Object callbackArg) throws NotAuthorizedException { GetOperationContext getContext = new GetOperationContextImpl(key, false); getContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, getContext)) { String errStr = String.format("Not authorized to perform GET operation on region [%s]", regionName); if (this.logger.fineEnabled()) { this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); } if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest( toString() + ": Authorized to perform GET operation on region [" + regionName + ']'); } } return getContext; }
public RemoveAllOperationContext removeAllAuthorize(String regionName, Collection<?> keys, Object callbackArg) throws NotAuthorizedException { RemoveAllOperationContext removeAllContext = new RemoveAllOperationContext(keys); removeAllContext.setCallbackArg(callbackArg); if (!this.authzCallback.authorizeOperation(regionName, removeAllContext)) { final String errStr = String.format("Not authorized to perform removeAll operation on region [%s]", regionName); if (this.logger.warningEnabled()) { this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); } if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger.finest(toString() + ": Authorized to perform removeAll operation on region [" + regionName + ']'); } } return removeAllContext; }
public ExecuteFunctionOperationContext executeFunctionAuthorize(String functionName, String region, Set keySet, Object arguments, boolean optimizeForWrite) throws NotAuthorizedException { ExecuteFunctionOperationContext executeContext = new ExecuteFunctionOperationContext( functionName, region, keySet, arguments, optimizeForWrite, false); if (!this.authzCallback.authorizeOperation(region, executeContext)) { final String errStr = "Not authorized to perform EXECUTE_REGION_FUNCTION operation"; if (this.logger.warningEnabled()) { this.logger.warning(String.format("%s : %s", new Object[] {this, errStr})); } if (this.isPrincipalSerializable) { throw new NotAuthorizedException(errStr, this.principal); } else { throw new NotAuthorizedException(errStr); } } else { if (this.logger.finestEnabled()) { this.logger .finest(toString() + ": Authorized to perform EXECUTE_REGION_FUNCTION operation "); } } return executeContext; }