Java Code Examples for com.hazelcast.nio.ObjectDataInput#readUTF()

The following examples show how to use com.hazelcast.nio.ObjectDataInput#readUTF() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UpdateSegmentsTask.java    From lumongo with Apache License 2.0 6 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	hazelcastPort = in.readInt();
	indexName = in.readUTF();
	newMemberToSegmentMap = new HashMap<>();
	int count = in.readInt();

	for (int i = 0; i < count; i++) {
		MemberImpl mi = new MemberImpl();
		mi.readData(in);
		Set<Integer> segments = new HashSet<>();
		int segCount = in.readInt();
		for (int j = 0; j < segCount; j++) {
			segments.add(in.readInt());
		}
		newMemberToSegmentMap.put(mi, segments);
	}

}
 
Example 2
Source File: Session.java    From lannister with Apache License 2.0 6 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	clientId = in.readUTF();
	ip = in.readUTF();
	port = in.readInt();
	isConnected = in.readBoolean();
	currentMessageId = in.readInt();

	if (in.readBoolean()) {
		will = new Message(in);
	}

	cleanSession = in.readBoolean();
	keepAliveSeconds = in.readInt();

	long rawLong = in.readLong();
	createTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;

	rawLong = in.readLong();
	lastIncomingTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;

	disposeLock = ClusterDataFactory.INSTANCE.createLock("Session_disposeLock_" + clientId);
	messageSender = new MessageSender(this);
}
 
Example 3
Source File: ConversionUtils.java    From vertx-hazelcast with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput objectDataInput) throws IOException {
  String className = objectDataInput.readUTF();
  int length = objectDataInput.readInt();
  byte[] bytes = new byte[length];
  objectDataInput.readFully(bytes);
  try {
    Class<?> clazz = loadClass(className);
    clusterSerializable = (ClusterSerializable) clazz.newInstance();
    clusterSerializable.readFromBuffer(0, Buffer.buffer(bytes));
  } catch (Exception e) {
    throw new IOException("Failed to load class " + className, e);
  }
}
 
Example 4
Source File: SequencerDefinitionSerializerHook.java    From snowcast with Apache License 2.0 5 votes vote down vote up
@Override
public SequencerDefinition read(@Nonnull ObjectDataInput in)
        throws IOException {

    String sequencerName = in.readUTF();
    long epochOffset = in.readLong();
    int maxLogicalNodeCount = in.readInt();
    short backupCount = in.readShort();

    SnowcastEpoch epoch = SnowcastEpoch.byTimestamp(epochOffset);
    return new SequencerDefinition(sequencerName, epoch, maxLogicalNodeCount, backupCount);
}
 
Example 5
Source File: DataSerializableDomainObject.java    From hazelcast-simulator with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
    key = in.readUTF();
    stringVal = in.readUTF();
    doubleVal = in.readDouble();
    longVal = in.readLong();
    intVal = in.readInt();
}
 
Example 6
Source File: DataSerializableEmployee.java    From hazelcast-simulator with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput objectDataInput) throws IOException {
    id = objectDataInput.readInt();
    name = objectDataInput.readUTF();
    age = objectDataInput.readInt();
    active = objectDataInput.readBoolean();
    salary = objectDataInput.readDouble();
}
 
Example 7
Source File: RemoteCommandSerialiser.java    From concursus with MIT License 5 votes vote down vote up
@Override
public RemoteCommand read(ObjectDataInput objectDataInput) throws IOException {
    String commandJson = objectDataInput.readUTF();
    return CommandJson.fromString(commandJson, commandTypeMatcher, objectMapper)
            .map(RemoteCommand::processing)
            .orElseThrow(() -> new IllegalArgumentException("No command type matcher found for command " + commandJson));
}
 
Example 8
Source File: TopicSubscription.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	clientId = in.readUTF();
	topicFilter = in.readUTF();

	int rawInt = in.readInt();
	qos = rawInt != Integer.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;
}
 
Example 9
Source File: Topic.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	name = in.readUTF();

	if (in.readBoolean()) {
		retainedMessage = new Message(in);
	}
}
 
Example 10
Source File: MessageStatus.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	messageKey = in.readUTF();
	clientId = in.readUTF();
	messageId = in.readInt();
	topicName = in.readUTF();

	long rawLong = in.readLong();
	createTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;

	rawLong = in.readLong();
	updateTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;
}
 
Example 11
Source File: Message.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	id = in.readInt();
	topicName = in.readUTF();
	publisherId = in.readUTF();
	message = in.readByteArray();

	int rawInt = in.readInt();
	qos = rawInt != Byte.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;

	isRetain = in.readBoolean();
}
 
Example 12
Source File: RefreshToken.java    From light-oauth2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
  this.refreshToken = in.readUTF();
  this.userId = in.readUTF();
  this.userType = in.readUTF();
  this.roles = in.readUTF();
  this.clientId = in.readUTF();
  this.scope = in.readUTF();
  this.remember = in.readUTF();
}
 
Example 13
Source File: User.java    From light-oauth2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
  this.userId = in.readUTF();
  this.userType = User.UserTypeEnum.fromValue(in.readUTF());
  this.firstName = in.readUTF();
  this.lastName = in.readUTF();
  this.email = in.readUTF();
  this.password = in.readUTF();
  this.roles = in.readUTF();
}
 
Example 14
Source File: HazelcastNodeInfo.java    From vertx-hazelcast with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput dataInput) throws IOException {
  String host = dataInput.readUTF();
  int port = dataInput.readInt();
  byte[] bytes = dataInput.readByteArray();
  nodeInfo = new NodeInfo(host, port, bytes != null ? new JsonObject(Buffer.buffer(bytes)) : null);
}
 
Example 15
Source File: Provider.java    From light-oauth2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
  this.providerId = in.readUTF();
  this.serverUrl = in.readUTF();
  this.uri = in.readUTF();
  this.providerName = in.readUTF();
}
 
Example 16
Source File: Service.java    From light-oauth2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
  this.serviceId = in.readUTF();
  this.serviceType = Service.ServiceTypeEnum.fromValue(in.readUTF());
  this.serviceName = in.readUTF();
  this.serviceDesc = in.readUTF();
  this.ownerId = in.readUTF();
  this.host = in.readUTF();
  this.scope = in.readUTF();
}
 
Example 17
Source File: TopicSubscriber.java    From lannister with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	topicName = in.readUTF();
	clientId = in.readUTF();
}
 
Example 18
Source File: ServiceEndpoint.java    From light-oauth2 with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput objectDataInput) throws IOException {
    this.endpoint = objectDataInput.readUTF();
    this.operation = objectDataInput.readUTF();
    this.scope = objectDataInput.readUTF();
}
 
Example 19
Source File: HazelcastServerID.java    From vertx-hazelcast with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput dataInput) throws IOException {
  port = dataInput.readInt();
  host = dataInput.readUTF();
}
 
Example 20
Source File: HostInfo.java    From Knowage-Server with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	availableProcessors = in.readInt();
	hardwareFingerprint = in.readUTF();
	hardwareId = in.readUTF();
}