/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
* Portions Copyright 2013 ForgeRock AS.
*/
/**
* This class specifies the parameters of a search request on the ECL.
* It is used as an interface between the requestor (plugin part)
* - either as an han
*/
{
/**
* This specifies that the ECL is requested from a provided cookie value
* defined as a MultiDomainServerState.
*/
/**
* This specifies that the ECL is requested from a provided interval
* of change numbers (as defined by draft-good-ldap-changelog [CHANGELOG]
* and NOT replication change numbers).
* TODO: not yet implemented
*/
/**
* This specifies that the ECL is requested ony for the entry that have
* a repl change number matching the provided one.
* TODO: not yet implemented
*/
/**
* This specifies that the request on the ECL is a PERSISTENT search
* with changesOnly = false.
*/
/**
* This specifies that the request on the ECL is a NOT a PERSISTENT search.
*/
/**
* This specifies that the request on the ECL is a PERSISTENT search
* with changesOnly = true.
*/
// The type of request as defined by REQUEST_TYPE_...
private short eclRequestType;
// When eclRequestType = FROM_COOKIE,
// specifies the provided cookie value.
// When eclRequestType = FROM_CHANGE_NUMBER,
// specifies the provided change number first and last - [CHANGELOG]
// When eclRequestType = EQUALS_REPL_CHANGE_NUMBER,
// specifies the provided replication change number.
// Specifies whether the search is persistent and changesOnly
// A string helping debuging and tracing the client operation related when
// processing, on the RS side, a request on the ECL.
// Excluded domains
/**
* Creates a new StartSessionMsg message from its encoded form.
*
* @param in The byte array containing the encoded form of the message.
* @throws java.util.zip.DataFormatException If the byte array does not
* contain a valid encoded form of the message.
*/
{
/*
* The message is stored in the form:
* <message type><status><assured flag><assured mode><safe data level>
* <list of referrals urls>
* (each referral url terminates with 0)
*/
try
{
/* first bytes are the header */
int pos = 0;
/* first byte is the type */
{
throw new DataFormatException(
}
// start mode
// sequenceNumber
// stopSequenceNumber
// replication changeNumber
// persistentSearch mode
// generalized state
// operation id
// excluded DN
{
}
} catch (UnsupportedEncodingException e)
{
throw new DataFormatException("UTF-8 is not supported by this jvm.");
} catch (IllegalArgumentException e)
{
throw new DataFormatException(e.getMessage());
}
}
/**
* Creates a new StartSessionMsg message with the given required parameters.
*/
public StartECLSessionMsg()
{
crossDomainServerState = "";
firstDraftChangeNumber = -1;
lastDraftChangeNumber = -1;
operationId = "-1";
}
/**
* {@inheritDoc}
*/
{
{
}
try
{
byte[] byteMode =
byte[] byteSequenceNumber =
byte[] byteStopSequenceNumber =
byte[] byteChangeNumber =
byte[] bytePsearch =
byte[] byteGeneralizedState =
byte[] byteOperationId =
byte[] byteExcludedDNs =
int length =
1;
byte[] resultByteArray = new byte[length];
int pos = 0;
return resultByteArray;
} catch (IOException e)
{
// never happens
return null;
}
}
/**
* {@inheritDoc}
*/
{
" requestType="+ eclRequestType +
" persistentSearch=" + isPersistent +
" changeNumber=" + changeNumber +
" firstDraftChangeNumber=" + firstDraftChangeNumber +
" lastDraftChangeNumber=" + lastDraftChangeNumber +
" generalizedState=" + crossDomainServerState +
" operationId=" + operationId +
}
/**
* Getter on the changer number start.
* @return the changer number start.
*/
public int getFirstDraftChangeNumber()
{
return firstDraftChangeNumber;
}
/**
* Getter on the changer number stop.
* @return the change number stop.
*/
public int getLastDraftChangeNumber()
{
return lastDraftChangeNumber;
}
/**
* Setter on the first changer number (as defined by [CHANGELOG]).
* @param firstDraftChangeNumber the provided first change number.
*/
{
}
/**
* Setter on the last changer number (as defined by [CHANGELOG]).
* @param lastDraftChangeNumber the provided last change number.
*/
{
}
/**
* Getter on the replication change number.
* @return the replication change number.
*/
{
return changeNumber;
}
/**
* Setter on the replication change number.
* @param changeNumber the provided replication change number.
*/
{
this.changeNumber = changeNumber;
}
/**
* Getter on the type of request.
* @return the type of request.
*/
public short getECLRequestType()
{
return eclRequestType;
}
/**
* Setter on the type of request.
* @param eclRequestType the provided type of request.
*/
{
this.eclRequestType = eclRequestType;
}
/**
* Getter on the persistent property of the search request on the ECL.
* @return the persistent property.
*/
public short isPersistent()
{
return this.isPersistent;
}
/**
* Setter on the persistent property of the search request on the ECL.
* @param isPersistent the provided persistent property.
*/
{
this.isPersistent = isPersistent;
}
/**
* Getter of the cross domain server state.
* @return the cross domain server state.
*/
{
return this.crossDomainServerState;
}
/**
* Setter of the cross domain server state.
* @param crossDomainServerState the provided cross domain server state.
*/
{
}
/**
* Setter of the operation id.
* @param operationId The provided opration id.
*/
{
this.operationId = operationId;
}
/**
* Getter on the operation id.
* @return the operation id.
*/
{
return this.operationId;
}
/**
* Getter on the list of excluded ServiceIDs.
* @return the list of excluded ServiceIDs.
*/
{
return this.excludedServiceIDs;
}
/**
* Setter on the list of excluded ServiceIDs.
* @param excludedServiceIDs the provided list of excluded ServiceIDs.
*/
{
this.excludedServiceIDs = excludedServiceIDs;
}
}