@Override public Object attempt(Connection cnx) throws Exception { throw new ServerOperationException("Something didn't work"); }
@Override public Object attempt(Connection cnx) throws Exception { throw new ServerOperationException("Something didn't work"); }
@Override public void handle(ChunkedMessage cm) throws Exception { Part part = cm.getPart(0); try { Object o = part.getObject(); if (o instanceof Throwable) { String s = "While performing a remote getAll"; exceptionRef[0] = new ServerOperationException(s, (Throwable) o); } else { VersionedObjectList chunk = (VersionedObjectList) o; chunk.replaceNullIDs(con.getEndpoint().getMemberId()); result.addAll(chunk); } } catch (Exception e) { exceptionRef[0] = new ServerOperationException("Unable to deserialize value", e); } } });
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return Integer.valueOf(part.getInt()); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxIdForType"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return Integer.valueOf(part.getInt()); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxIdForEnum"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.REPLY) { return part.getObject(); } else if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote proxy cache close"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError("Unexpected message type " + MessageType.getString(msgType)); } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return (Map<Integer, EnumInfo>) part.getObject(); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxEnums"; throw new ServerOperationException(s, (Throwable) part.getObject()); } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return part; } else { if (msgType == MessageType.REQUEST_EVENT_VALUE_ERROR) { // Value not found in haContainer. return null; } else if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getFullValue"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return (Map<Integer, PdxType>) part.getObject(); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxTypes"; throw new ServerOperationException(s, (Throwable) part.getObject()); } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
throw (PutAllPartialResultException) t; } else { throw new ServerOperationException(s, t); throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError("Unexpected message type " + MessageType.getString(msgType));
/** * Process a response that contains a single Object result. * * @param msg the message containing the response * @param opName text describing this op * @return the result of the response * @throws Exception if response could not be processed or we received a response with a server * exception. */ protected Object processObjResponse(Message msg, String opName) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return part.getObject(); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + opName; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError("Unexpected message type " + MessageType.getString(msgType)); } } }
exceptionRef[0] = new ServerOperationException(s, (Throwable) o); } else { VersionedObjectList chunk = (VersionedObjectList) o; exceptionRef[0] = new ServerOperationException("Unable to deserialize value", e);
if (o instanceof Throwable) { String s = "While performing a remote keySet"; exceptionRef[0] = new ServerOperationException(s, (Throwable) o); } else { result.addAll((List) o); Part part = msg.getPart(0); String s = "While performing a remote " + "keySet"; throw new ServerOperationException(s, (Throwable) part.getObject()); keySetResponseMessage.receiveChunk(); Part part = msg.getPart(0); throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError(
exceptionRef[0] = new ServerOperationException(s, (Throwable) o); } else { VersionedObjectList chunk = (VersionedObjectList) o; exceptionRef[0] = new ServerOperationException("Unable to deserialize value", e);
if (o instanceof Throwable) { String s = "While performing a remote GetDurableCQs"; exceptionRef[0] = new ServerOperationException(s, (Throwable) o); } else { result.addAll((List) o); Part part = msg.getPart(0); String s = "While performing a remote GetDurableCQs"; throw new ServerOperationException(s, (Throwable) part.getObject()); getDurableCQsResponseMsg.receiveChunk(); Part part = msg.getPart(0); throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError(
@Override protected Object processResponse(Message m) throws Exception { ChunkedMessage msg = (ChunkedMessage) m; msg.readHeader(); int msgType = msg.getMessageType(); msg.receiveChunk(); if (msgType == MessageType.REPLY) { return Boolean.TRUE; } else { if (msgType == MessageType.EXCEPTION) { Part part = msg.getPart(0); String s = "While performing a remote " + getOpName(); throw new ServerOperationException(s, (Throwable) part.getObject()); } else if (isErrorResponse(msgType)) { Part part = msg.getPart(0); // Dan Smith- a hack, but I don't want to change the protocol right // now. We need to throw a security exception so that the exception // will be propagated up properly. Ideally, this exception would be // contained in the message.. String errorMessage = part.getString(); if (errorMessage.indexOf("Not authorized") >= 0) { throw new NotAuthorizedException(errorMessage); } throw new ServerOperationException(errorMessage); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
throw new ServerOperationException(s, (Throwable) part.getObject()); throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError(
throw new ServerOperationException(s, (Throwable) obj);
public AuthenticateUserOpImpl(Connection con, ExecutablePool pool) { super(MessageType.USER_CREDENTIAL_MESSAGE, 1); byte[] credentialBytes = null; DistributedMember server = new InternalDistributedMember(con.getSocket().getInetAddress(), con.getSocket().getPort(), false); DistributedSystem sys = InternalDistributedSystem.getConnectedInstance(); String authInitMethod = sys.getProperties().getProperty(SECURITY_CLIENT_AUTH_INIT); Properties tmpSecurityProperties = sys.getSecurityProperties(); // LOG: following passes the DS API LogWriters into the security API Properties credentials = Handshake.getCredentials(authInitMethod, tmpSecurityProperties, server, false, (InternalLogWriter) sys.getLogWriter(), (InternalLogWriter) sys.getSecurityLogWriter()); getMessage().setMessageHasSecurePartFlag(); HeapDataOutputStream heapdos = new HeapDataOutputStream(Version.CURRENT); try { DataSerializer.writeProperties(credentials, heapdos); credentialBytes = ((ConnectionImpl) con).encryptBytes(heapdos.toByteArray()); } catch (Exception e) { throw new ServerOperationException(e); } finally { heapdos.close(); } getMessage().addBytesPart(credentialBytes); }
Part part = msg.getPart(0); String s = "While performing a remote " + opName; throw new ServerOperationException(s, (Throwable) part.getObject()); msg.receiveChunk(); Part part = msg.getPart(0); throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError("Unexpected message type " + MessageType.getString(msgType));